# -------------------------------------------------------------------
#       -*- coding: utf-8 -*-
#   @Project    :   studentSystem
#   @File       :   多态类.py
#   @Author     :   WANGYU
#   @Time       :   2021-09-13 16:26:42
#   @Software   :   PyCharm
#   @Desc       :   
# -------------------------------------------------------------------


class Instrument():
    def make_sound(self):
        pass


class ErHu(Instrument):
    def make_sound(self):
        print('erhu play ... ')


class Piano(Instrument):
    def make_sound(self):
        print('piano play ... ')


class Vinlin(Instrument):
    def make_sound(self):
        print('vinlin play ... ')


def play(instrument):
    instrument.make_sound()


if __name__ == '__main__':
    # erhu=ErHu()
    # erhu.make_sound()
    #
    # piano = Piano()
    # piano.make_sound()
    #
    # vinlin = Vinlin()
    # vinlin.make_sound()
    play(ErHu())  # play(二胡对象)
